﻿@using SESM.Models.Views.Settings
@model SESM.Models.Views.Settings.DiagnosisViewModel
@{
    ViewBag.Title = "Diagnosis";
}

<div class="row">
    <div class="jumbotron">
        @if (Model.ElementList.Count(x => x.State != true) == 0)
        {
            <br/>
            <br/>
            <h1 class="text-center"><span style ="transform: scale(3.0, 3.0);" class="glyphicon glyphicon glyphicon-ok-circle green"></span></h1>
            <br />
            <br />
            <br/>
            <h1 class="text-center">Congratulation, All seams in order!</h1>
            <p class="text-center">If you want to know more, expand the panel below</p>
            <p class="text-center"><span class="glyphicon glyphicon-arrow-down"></span></p>
        }
        else
        {
            <br />
            <br />
            <h1 class="text-center"><span style="transform: scale(3.0, 3.0);" class="glyphicon glyphicon glyphicon-remove-circle red"></span></h1>
            <br />
            <br />
            <br />
            <h1 class="text-center">Argh, There is a problem captain!</h1>
            <p class="text-center">To know more, expand the panel below</p>
            <p class="text-center"><span class="glyphicon glyphicon-arrow-down"></span></p>
        }
    </div>
    <div class="panel-group" id="accordion">
        <div class="panel panel-default">
            <div class="panel-heading">
                <h4 class="panel-title">
                    <a data-toggle="collapse" data-parent="#accordion" href="#collapseOne">
                        Detailed Diagnosis
                    </a>
                </h4>
            </div>
            <div id="collapseOne" class="panel-collapse collapse">
                <div class="panel-body">
                    @foreach (DiagnosisElement item in Model.ElementList)
                    {
                        if (item.State == true)
                        {
                            <div class="alert alert-success">
                                <h4><span class="glyphicon glyphicon-ok"></span> @item.Name</h4>
                                <p>@Html.Raw(item.Message)</p>
                            </div>
                        }
                        if (item.State == null)
                        {
                            <div class="alert alert-info">
                                <h4><span class="glyphicon glyphicon-minus"></span> @item.Name</h4>
                                <p>@Html.Raw(item.Message)</p>
                            </div>
                        }
                        if (item.State == false)
                        {
                            <div class="alert alert-danger">
                                <h4><span class="glyphicon glyphicon-remove"></span> @item.Name</h4>
                                <p>@Html.Raw(item.Message)</p>
                            </div>
                        }
                    }
                </div>
            </div>
        </div>
    </div>
</div>